﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Ken_WPF_UI.View.otherUI
{
    /// <summary>
    /// Login01Window.xaml 的交互逻辑
    /// </summary>
    public partial class Login01Window : Window
    {
        public Login01Window()
        {
            InitializeComponent();
        }

        private void LoadedWindow(object sender, RoutedEventArgs e)
        {
            RadioButton radioButton = new RadioButton() { Content="教导主任"};
            radioButton.GroupName = "role";
            radioButton.Checked += RadioChecked;
            radioButton.HorizontalAlignment = HorizontalAlignment.Left;
            radioButton.VerticalAlignment = VerticalAlignment.Top;
            radioButton.Margin = new Thickness(104, 215, 0, 0);
            Grid.SetColumn(radioButton, 4);//xaml的grid.column 点击f12 看看怎么设置
            this.grid.Children.Add(radioButton);
        }


        /// <summary>
        /// 单选框点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void RadioChecked(object sender, RoutedEventArgs e)
        {
            if(sender is RadioButton)
            {
                MessageBox.Show((sender as RadioButton).Content.ToString());

            }
        }
    }
}
